import request from '@/utils/request'
import cache from "@/plugins/cache";

// 查询变量寄存器配置列表
export function listQstag(query) {
  return request({
    url: '/system/qstag/list',
    method: 'get',
    params: query
  })
}

// 查询变量寄存器配置详细
export function getQstag(tagid) {
  return request({
    url: '/system/qstag/' + tagid,
    method: 'get'
  })
}

// 新增变量寄存器配置
export function addQstag(data) {
  return request({
    url: '/system/qstag',
    method: 'post',
    data: data
  })
}

// 修改变量寄存器配置
export function updateQstag(data) {
  return request({
    url: '/system/qstag',
    method: 'put',
    data: data
  })
}

// 删除变量寄存器配置
export function delQstag(tagid) {
  return request({
    url: '/system/qstag/' + tagid,
    method: 'delete'
  })
}

//报警等级
export function alarmLevelSelect() {
  return request({
    url: '/system/qstag/listAllAlarmType',
    method: 'get'
  })
}

export function getDbName() {
  return cache.local.get("currentProject");
}

